<template>
  <div>
    <GanttChart ref="GanttChart" :tasks="tasks" />
  </div>
</template>

<script>
import GanttChart from "./GanttChart.vue";
export default {
  name: "GanttChartIndex",
  components: {
    GanttChart,
  },
  data() {
    return {
      tasks: {
        data: [
          {
            id: 1,
            text: "Task #1",
            start_date: "2022-03-01 11:10",
            end_date: "2022-05-11 11:20",
            duration: 5,
          },
          {
            id: 2,
            text: "Task #2",
            start_date: "2022-03-06 15:00",
            duration: 4,
            parent: 1,
          },
          {
            id: 3,
            text: "Task #3",
            start_date: "2022-03-10 13:22",
            duration: 6,
            parent: 1,
          },
        ],
        links: [],
      },
    };
  },
  watch: {
    tasks: {
      handler(v) {
        console.log(v, "v--");
      },
      deep: true,
    },
  },
  mounted() {
    this.getData();
  },
  methods: {
    getData() {
      const data = [
        {
          series: 2023102900000083,
          node_num_id: 1,
          node_name: "低压工程",
          start_plan_date: "2023-08-22 08:00",
          end_plan_date: "2023-09-26 18:00",
          start_real_date: "2023-09-26 18:00",
          end_real_date: "2023-09-26 18:00",
          material_mode_id: "",
          material_mode_name: "",
          material_num_id: "",
          material_name: "",
          remark: "",
          node: 0,
          order_service_type: 1,
          order_service_type_name: "低压工程",
          examine_status: 10,
          examine_date: "",
          examine_user_name: "",
          examine_user_num_id: "",
          examine_remark: "",
          child: [
            {
              series: 2023102900000084,
              node_num_id: 1027001,
              node_name: "入场手续办理 ",
              start_plan_date: "2023-08-22 08:00",
              end_plan_date: "2023-08-23 18:00",
              start_real_date: "2023-08-23 17:47",
              end_real_date: "2023-08-23 17:47",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
            {
              series: 2023102900000085,
              node_num_id: 1027002,
              node_name: "技术交底、安全交底",
              start_plan_date: "2023-08-22 08:00",
              end_plan_date: "2023-08-23 18:00",
              start_real_date: "2023-08-23 17:46",
              end_real_date: "2023-08-23 17:46",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
            {
              series: 2023102900000086,
              node_num_id: 1027003,
              node_name: "材料设备准备",
              start_plan_date: "2023-08-22 08:00",
              end_plan_date: "2023-08-23 18:00",
              start_real_date: "2023-08-22 17:48",
              end_real_date: "2023-08-22 17:48",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
            {
              series: 2023102900000087,
              node_num_id: 1027004,
              node_name: "围挡搭建（场地清理）",
              start_plan_date: "2023-08-22 08:00",
              end_plan_date: "2023-08-25 18:00",
              start_real_date: "2023-08-22 08:00",
              end_real_date: "2023-08-23 17:15",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
            {
              series: 2023102900000088,
              node_num_id: 1027005,
              node_name: "定位放线",
              start_plan_date: "2023-08-23 08:00",
              end_plan_date: "2023-08-23 18:00",
              start_real_date: "2023-08-23 17:40",
              end_real_date: "2023-08-23 17:40",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
            {
              series: 2023102900000089,
              node_num_id: 1027006,
              node_name: "车位开挖",
              start_plan_date: "2023-08-24 08:00",
              end_plan_date: "2023-09-05 18:00",
              start_real_date: "2023-08-24 08:00",
              end_real_date: "2023-09-05 10:45",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
            {
              series: 2023102900000090,
              node_num_id: 1027007,
              node_name: "雨棚基础开挖",
              start_plan_date: "2023-08-24 08:00",
              end_plan_date: "2023-09-05 18:00",
              start_real_date: "2023-09-06 17:42",
              end_real_date: "2023-09-06 17:42",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
            {
              series: 2023102900000091,
              node_num_id: 1027008,
              node_name: "监控基础开挖",
              start_plan_date: "2023-08-24 08:00",
              end_plan_date: "2023-09-05 18:00",
              start_real_date: "2023-08-24 08:00",
              end_real_date: "2023-09-05 18:00",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
            {
              series: 2023102900000092,
              node_num_id: 1027009,
              node_name: "充电桩基础开挖",
              start_plan_date: "2023-08-24 08:00",
              end_plan_date: "2023-09-05 18:00",
              start_real_date: "2023-09-05 17:33",
              end_real_date: "2023-09-05 17:33",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
            {
              series: 2023102900000093,
              node_num_id: 1027010,
              node_name: "主机基础开挖",
              start_plan_date: "2023-08-24 08:00",
              end_plan_date: "2023-09-05 18:00",
              start_real_date: "2023-09-05 17:41",
              end_real_date: "2023-09-05 17:41",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
            {
              series: 2023102900000094,
              node_num_id: 1027011,
              node_name: "管道敷设",
              start_plan_date: "2023-08-24 08:00",
              end_plan_date: "2023-09-05 18:00",
              start_real_date: "2023-09-05 17:36",
              end_real_date: "2023-09-05 17:36",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
            {
              series: 2023102900000095,
              node_num_id: 1027012,
              node_name: "雨棚基础支模及制作",
              start_plan_date: "2023-08-24 08:00",
              end_plan_date: "2023-09-05 18:00",
              start_real_date: "2023-09-14 08:00",
              end_real_date: "2023-09-05 18:00",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
            {
              series: 2023102900000096,
              node_num_id: 1027013,
              node_name: "监控基础支模及制作",
              start_plan_date: "2023-08-24 08:00",
              end_plan_date: "2023-09-05 18:00",
              start_real_date: "2023-09-05 18:00",
              end_real_date: "2023-09-05 18:00",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
            {
              series: 2023102900000097,
              node_num_id: 1027014,
              node_name: "充电桩基础支模及制作",
              start_plan_date: "2023-08-24 08:00",
              end_plan_date: "2023-09-05 18:00",
              start_real_date: "2023-08-24 08:00",
              end_real_date: "2023-09-06 18:00",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
            {
              series: 2023102900000098,
              node_num_id: 1027015,
              node_name: "主机基础砌筑支模及制作",
              start_plan_date: "2023-08-24 08:00",
              end_plan_date: "2023-09-05 18:00",
              start_real_date: "2023-09-05 18:00",
              end_real_date: "2023-09-05 18:00",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
            {
              series: 2023102900000099,
              node_num_id: 1027017,
              node_name: "雨棚基础浇筑",
              start_plan_date: "2023-08-24 08:00",
              end_plan_date: "2023-09-05 18:00",
              start_real_date: "2023-09-02 18:00",
              end_real_date: "2023-09-05 18:00",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
            {
              series: 2023102900000100,
              node_num_id: 1027018,
              node_name: "监控杆基础建筑",
              start_plan_date: "2023-08-24 08:00",
              end_plan_date: "2023-09-05 18:00",
              start_real_date: "2023-09-05 18:00",
              end_real_date: "2023-09-05 18:00",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
            {
              series: 2023102900000101,
              node_num_id: 1027019,
              node_name: "充电桩基础浇筑",
              start_plan_date: "2023-08-24 08:00",
              end_plan_date: "2023-09-05 18:00",
              start_real_date: "2023-09-05 17:33",
              end_real_date: "2023-09-05 17:33",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
            {
              series: 2023102900000102,
              node_num_id: 1027020,
              node_name: "主机基础浇筑",
              start_plan_date: "2023-08-24 08:00",
              end_plan_date: "2023-09-05 18:00",
              start_real_date: "2023-08-24 08:00",
              end_real_date: "2023-09-05 18:00",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
            {
              series: 2023102900000103,
              node_num_id: 1027021,
              node_name: "基础养护",
              start_plan_date: "2023-08-24 08:00",
              end_plan_date: "2023-09-05 18:00",
              start_real_date: "2023-09-06 17:40",
              end_real_date: "2023-09-06 17:40",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
            {
              series: 2023102900000104,
              node_num_id: 1027022,
              node_name: "电缆敷设、电线网线敷设穿线",
              start_plan_date: "2023-09-14 08:00",
              end_plan_date: "2023-08-16 18:00",
              start_real_date: "2023-09-16 17:43",
              end_real_date: "2023-09-16 17:43",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
            {
              series: 2023102900000105,
              node_num_id: 1027023,
              node_name: "电缆端子压接",
              start_plan_date: "2023-09-14 08:00",
              end_plan_date: "2023-09-16 18:00",
              start_real_date: "2023-09-22 17:31",
              end_real_date: "2023-09-22 17:31",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
            {
              series: 2023102900000106,
              node_num_id: 1027024,
              node_name: "雨棚安装",
              start_plan_date: "2023-09-17 08:00",
              end_plan_date: "2023-09-20 18:00",
              start_real_date: "2023-09-17 08:00",
              end_real_date: "2023-09-20 18:00",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
            {
              series: 2023102900000107,
              node_num_id: 1027025,
              node_name: "充电桩安装",
              start_plan_date: "2023-09-17 08:00",
              end_plan_date: "2023-09-20 18:00",
              start_real_date: "2023-09-20 17:32",
              end_real_date: "2023-09-20 17:32",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
            {
              series: 2023102900000108,
              node_num_id: 1027026,
              node_name: "主机安装",
              start_plan_date: "2023-09-17 08:00",
              end_plan_date: "2023-09-20 18:00",
              start_real_date: "2023-09-17 08:00",
              end_real_date: "2023-09-20 18:00",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
            {
              series: 2023102900000109,
              node_num_id: 1027027,
              node_name: "监控杆安装",
              start_plan_date: "2023-09-17 08:00",
              end_plan_date: "2023-09-20 18:00",
              start_real_date: "2023-09-20 18:00",
              end_real_date: "2023-09-20 18:00",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
            {
              series: 2023102900000110,
              node_num_id: 1027028,
              node_name: "雨棚投光灯安装",
              start_plan_date: "2023-09-17 08:00",
              end_plan_date: "2023-09-20 18:00",
              start_real_date: "2023-09-20 17:41",
              end_real_date: "2023-09-20 17:41",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
            {
              series: 2023102900000111,
              node_num_id: 1027029,
              node_name: "车位限位杆安装",
              start_plan_date: "2023-09-17 08:00",
              end_plan_date: "2023-09-20 18:00",
              start_real_date: "2023-09-17 08:00",
              end_real_date: "2023-09-20 17:30",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
            {
              series: 2023102900000112,
              node_num_id: 1027030,
              node_name: "指引牌安装",
              start_plan_date: "2023-09-17 08:00",
              end_plan_date: "2023-09-20 18:00",
              start_real_date: "2023-09-26 17:34",
              end_real_date: "2023-09-26 17:34",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
            {
              series: 2023102900000113,
              node_num_id: 1027031,
              node_name: "车位划线与喷字",
              start_plan_date: "2023-09-21 08:00",
              end_plan_date: "2023-09-24 18:00",
              start_real_date: "2023-09-24 18:30",
              end_real_date: "2023-09-24 18:30",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
            {
              series: 2023102900000114,
              node_num_id: 1027032,
              node_name: "充电桩标签",
              start_plan_date: "2023-09-21 08:00",
              end_plan_date: "2023-09-24 18:00",
              start_real_date: "2023-09-25 08:00",
              end_real_date: "2023-09-24 18:00",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
            {
              series: 2023102900000115,
              node_num_id: 1027034,
              node_name: "充电桩基础刷漆",
              start_plan_date: "2023-09-21 08:00",
              end_plan_date: "2023-09-24 18:00",
              start_real_date: "2023-09-24 17:38",
              end_real_date: "2023-09-24 17:38",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
            {
              series: 2023102900000116,
              node_num_id: 1027033,
              node_name: "主机基础刷漆",
              start_plan_date: "2023-09-21 08:00",
              end_plan_date: "2023-09-24 18:00",
              start_real_date: "2023-09-21 08:00",
              end_real_date: "2023-09-24 18:00",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
            {
              series: 2023102900000117,
              node_num_id: 1027035,
              node_name: "现场验收整改",
              start_plan_date: "2023-09-25 08:00",
              end_plan_date: "2023-09-26 18:00",
              start_real_date: "2022-09-26 17:41",
              end_real_date: "2022-09-26 17:41",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
            {
              series: 2023102900000118,
              node_num_id: 1027036,
              node_name: "设备调试",
              start_plan_date: "2023-09-25 08:00",
              end_plan_date: "2023-09-26 18:00",
              start_real_date: "2023-09-26 08:00",
              end_real_date: "2023-09-25 08:00",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
            {
              series: 2023102900000119,
              node_num_id: 1027037,
              node_name: "垃圾清理，卫生打扫",
              start_plan_date: "2023-09-25 08:00",
              end_plan_date: "2023-09-26 18:00",
              start_real_date: "2023-09-25 08:00",
              end_real_date: "2023-09-26 18:00",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
            {
              series: 2023102900000120,
              node_num_id: 1027038,
              node_name: "完工",
              start_plan_date: "2023-09-25 08:00",
              end_plan_date: "2023-09-26 18:00",
              start_real_date: "2023-10-26 18:00",
              end_real_date: "2023-10-26 18:00",
              material_mode_id: "",
              material_mode_name: "",
              material_num_id: "",
              material_name: "",
              remark: "",
              node: 1,
              order_service_type: 1,
              order_service_type_name: "低压工程",
              examine_status: 10,
              examine_date: "",
              examine_user_name: "",
              examine_user_num_id: "",
              examine_remark: "",
              child: [],
            },
          ],
        },
      ];
      this.tasks.data = this.assemblyData(data);
      console.log(this.tasks, " this.tasks-");
      this.$refs.GanttChart.initGantt();
    },
    assemblyData(data, series) {
      if (!data.length) return [];
      if (!this.$tasks) {
        this.$tasks = [];
      }

      data.map((item) => {
        this.$tasks.push({
          id: item.series,
          text: item.node_name,
          start_date: item.start_real_date,
          duration: 4,
          parent: series || 0,
        });
        if (item.child.length) {
          this.$tasks.push(...this.assemblyData(item.child, item.series));
        }
      });

      return this.$tasks;
    },
  },
};
</script>

<style lang="scss" scoped></style>
